package com.atguigu.day05.test;

import java.util.Scanner;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/4 17:04
 * @注释
 */
public class ArrayTest09 {
    public static void main(String[] args) {
        int[] arr = {10, 20, 30, 40, 50, 60, 70, 80, 90, 11, 22, 33};
        Scanner sc = new Scanner(System.in);
        System.out.println("请您输入一个数:");
        int num = sc.nextInt();
        int index = -1;
        for (int i = 0; i < arr.length; i++) {
            if(num == arr[i]){
                index = i;
            }
        }
        if(index == -1){
            System.out.println("您所输入的数字不在数组中");
        }else{
            System.out.println(num + "--->" + index);
        }

    }
}
